package com.ymttest.database.sqlwapper;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ymt.database.SqlManager;
import com.ymttest.database.model.couponsendtask;
import com.ymttest.utils.EnvSetup;

public class couponsendtaskWapper {
	SqlManager manager;

    public couponsendtaskWapper() {
        manager = new SqlManager("mysqlcoupon" + EnvSetup.getEnv());
    }
    public couponsendtask selectByPrimaryKey(Integer taskId)  {
    	couponsendtask couponsendtask=new couponsendtask();
    	Map map=new HashMap<String,Object>();
    	map.put("taskId", taskId);
        List<couponsendtask> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.couponsendtaskMapper.selectByPrimaryKey",
                        map);
        if(result.size()>0)
        {
        	couponsendtask=result.get(0);	
        }
        return couponsendtask;
    }
    
    public List<couponsendtask> selectByCouponBatchCode(String BatchCode)  {
    	Map map=new HashMap<String,Object>();
    	map.put("BatchCode", BatchCode);
        List<couponsendtask> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.couponsendtaskMapper.selectByCouponBatchCode",
                        map);
        return result;
    }
    public List<couponsendtask> selectTop1()  {
        List<couponsendtask> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.couponsendtaskMapper.selectTop1",
                        null);
        manager.commit();
        return result;
    }
    public List<couponsendtask> selectByCreateTimeAndTaskType(String CreateStartTime,String CreateEndTime)  {
    	Map map=new HashMap<String,Object>();
    	map.put("CreateStartTime", CreateStartTime);
    	map.put("CreateEndTime", CreateEndTime);
        List<couponsendtask> result = manager
                .getSelectResults(
                        "com.ymttest.database.mapping.couponsendtaskMapper.selectByCreateTimeAndTaskType",
                        map);
        return result;
    }



    public static void main(String[] args) {
    	couponsendtaskWapper test = new couponsendtaskWapper();

      //  System.out.println(test.usecouponsendtask(20238699, "AIL7PT3W1",null));
        // test.insertYmtcouponsendtaskSetting(3,11);
        // Logger.debug(test.getLastYmtcouponsendtaskSettingId());


    }
}
